extends "../cTDZ_2/cTDZ_2.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "骷髅法师"
	lv = 2
	attCoe.atkRan = 3
	attCoe.atk = 40 / 8.5 * 2 / 2
	attCoe.maxHp = 600 / 112.5 / 2
	attAdd.spd = 0.5
	addSkillTxt("灵魂汲取：普攻伤害变为真伤，60%伤害转化为治疗量治疗生命比最低的单位")
var sc = 0.6
func _onAtkChara(atkinfo):
	if !atkinfo.isMiss && atkinfo.atkType == Chara.AtkType.NORMAL:
		var chas = getAllChas(2)
		chas.sort_custom(self,"sort")
		if !chas.size():return
		healCha(chas[0],atkinfo.hurtVal * sc)
		atkinfo.hurtVal *= (1 - sc)
		atkinfo.hurtType = Chara.HurtType.REAL
	._onAtkChara(atkinfo)

func sort(a,b):
	return (a.att.hp / a.att.maxHp) < (b.att.hp / b.att.maxHp)

